﻿using System;
using SpiderMaster.AspNet.TradingSystem.BusinessLogicLayer;
using SpiderMaster.AspNet.TradingSystem.DataAccessLayer;
using SpiderMaster;

namespace SpiderMaster.AspNet.TradingSystem
{
    /// <summary> The Trading Center Member Common Listing Information.
    /// </summary>
    [Serializable]
    [ReganSchroder(1, 10, 2009)]
    public sealed partial class TradingCenterMemberListingCommon
    {
        /// <summary> Empty. </summary>
        public static TradingCenterMemberListingCommon Empty;
        static TradingCenterMemberListingCommon()
        {
            Empty = new TradingCenterMemberListingCommon();
        }
        private TradingCenterMemberListingCommon()
        {
            CreatedListingsCurrent = DefaultValues.IdNullValue;
            CreatedListingsFailedCurrent = DefaultValues.IdNullValue;
            CreatedListingsSuccessCurrent = DefaultValues.IdNullValue;
            CreatedListingsPendingAccountCredit = DefaultValues.IdNullValue;
            CreatedListingsPendingModeration = DefaultValues.IdNullValue;

            UserName = string.Empty;

            WatchedListingsCurrent = DefaultValues.IdNullValue;
            WatchedListingsFailedCurrent = DefaultValues.IdNullValue;
            WatchedListingsSuccessCurrent = DefaultValues.IdNullValue;
        }
        private TradingCenterMemberListingCommon(MembersDataComponent.MembersRow MemberData)
        {
            if (MemberData.IsNotNull())
            {

                UserName = MemberData.AspNetUsername;

                // TODO:
                //CreatedListingsCurrent = MemberData.CreatedListingsCurrent;
                //CreatedListingsFailedCurrent = MemberData.CreatedListingsFailedCurrent;
                //CreatedListingsSuccessCurrent = MemberData.CreatedListingsSuccessCurrent;
                //CreatedListingsPendingAccountCredit = MemberData.CreatedListingsPendingAccountCredit;
                //CreatedListingsPendingModeration = MemberData.CreatedListingsPendingModeration;

                //UserName = MemberData.UserName;

                //WatchedListingsCurrent = MemberData.WatchedListingsCurrent;
                //WatchedListingsFailedCurrent = MemberData.WatchedListingsFailedCurrent;
                //WatchedListingsSuccessCurrent = MemberData.WatchedListingsSuccessCurrent;
            }
        }

        /// <summary> Gets or sets the created listings current. </summary>
        /// <value>The created listings current.</value>
        public int CreatedListingsCurrent { get; private set; }

        /// <summary> Gets or sets the created listings failed current. </summary>
        /// <value>The created listings failed current.</value>
        public int CreatedListingsFailedCurrent { get; private set; }

        /// <summary> Gets or sets the created listings success current. </summary>
        /// <value>The created listings success current.</value>
        public int CreatedListingsSuccessCurrent { get; private set; }

        /// <summary> Gets or sets the created listings pending account credit.
        /// </summary>
        /// <value>The created listings pending account credit.</value>
        public int CreatedListingsPendingAccountCredit { get; private set; }

        /// <summary> Gets or sets the created listings pending moderation. </summary>
        /// <value>The created listings pending moderation.</value>
        public int CreatedListingsPendingModeration { get; private set; }

        ///// <summary> Gets or sets the favourite search location.
        ///// </summary>
        ///// <value>The favourite search location.</value>
        //public Location FavouriteSearchLocation { get; private set; }

        /// <summary> Gets or sets the name of the user. </summary>
        /// <value>The name of the user.</value>
        public string UserName { get; private set; }

        /// <summary> Gets or sets the watched listings current. </summary>
        /// <value>The watched listings current.</value>
        public int WatchedListingsCurrent { get; private set; }

        /// <summary> Gets or sets the watched listings failed current. </summary>
        /// <value>The watched listings failed current.</value>
        public int WatchedListingsFailedCurrent { get; private set; }

        /// <summary> Gets or sets the watched listings success current. </summary>
        /// <value>The watched listings success current.</value>
        public int WatchedListingsSuccessCurrent { get; private set; }
    }
}